const { verifyToken } = require("../../utils/token")
const restService = require("../../service/rest/RestService")
const { myAssert } = require("../../utils")
const os = require('os');
module.exports = ({ app, router }) => {
    router.post("/add", async (req, res) => {
        myAssert(await restService.addService(req), res, "添加失败！")
    })
    router.delete("/del", async (req, res) => {
        myAssert(await restService.deleteService(req), res, "删除失败！")
    })
    router.patch("/update", async (req, res) => {
        myAssert(await restService.updateService(req), res, "更新失败！")
    })

    router.get("/get", async (req, res) => {
        myAssert(await restService.getService(req), res, "获取失败！")
    })

    router.get("/getList", async (req, res) => {
        myAssert(await restService.getListService(req), res, "获取列表失败！")
    })
    
    router.get("/getCount", async (req, res) => {
        myAssert(await restService.getCountService(req), res, "获取数量失败！")
    })   
}
